﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace moose.irc.standard
{
    /// <summary>
    /// Provides various utility methods for IRCMessages
    /// </summary>
    internal static class MessageUtility
    {

        /// <summary>
        /// Returns Command and arguments, as though it were to be printed
        /// </summary>
        /// <param name="input">IrcMessage</param>
        /// <returns>a string</returns>
        internal static string print(IrcMessage input)
        {
            StringBuilder sbMessage = new StringBuilder();
            if (input.Arguments.Count == 0) return sbMessage.ToString();
            sbMessage.Append('+');
            for (int i = 1; i < input.Arguments.Count(); i++)
            {
                sbMessage.Append(input.Arguments[i]);
                sbMessage.Append(' ');
            }
           return sbMessage.ToString();
        }

    }
}
